package top.z.orm.core.osql.chain;

import top.z.orm.core.osql.Op;
import top.z.orm.core.osql.OrderType;

/**
 * Select接口,用于链式风格写SQL语句
 */
public interface Select extends ToSql {

    Select lParenthesis();

    Select rParenthesis();

    Select op(String field, Op Op, String value);

    Select op(String field, Op Op, Number value);

    Select op(String field, String value);

    Select op(String field, Number value);

    Select and();

    Select or();

    Select where();

    Select where(String expression);

    Select select();

    Select select(String column);

    Select distinct(String field);

    Select from(String table);

    Select join(String anotherTable);

    Select innerJoin(String anotherTable);

    Select leftJoin(String anotherTable);

    Select rightJoin(String anotherTable);

    Select on();

    Select on(String expression);

    Select between(String field, Number low, Number high);

    Select notBetween(String field, Number low, Number high);

    Select isNull(String field);

    Select isNotNull(String field);

    Select in(String field, Number... valueList);

    Select notIn(String field, Number... valueList);

    Select in(String field, String valueList);

    Select notIn(String field, String valueList);

    Select groupBy(String field);

    Select having(String expression);

    Select orderBy(String field);

    Select orderBy(String field, OrderType orderType);

    Select start(int start);

    Select size(int size);

    Select exists(Select subSelect);

    Select exists(String subSelect);

    Select notExists(Select subSelect);

    Select notExists(String subSelect);

    Select in(Select subSelect);

    Select in(String subSelect);

    Select notIn(Select subSelect);

    Select notIn(String subSelect);
}